package com.hyacinth;

import com.hyacinth.repository.jpa.CustomerJpaRepositoryFactoryBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableTransactionManagement //开启事务配置
@EnableJpaRepositories(basePackages = {"com.hyacinth.repository.jpa"}, repositoryFactoryBeanClass = CustomerJpaRepositoryFactoryBean.class) // 指定jpaRepositories位置
@EnableElasticsearchRepositories(basePackages = {"com.hyacinth.repository.elasticsearch"}) // 指定esRepositories位置
@EnableRedisRepositories(basePackages = {"com.hyacinth.repository.redis"}) // 指定redisRepositories位置
public class Application {

	public static void main(String[] args) {
	    // 解决引入高版本redis客户端(包含netty)引发的问题
        System.setProperty("es.set.netty.runtime.available.processors", "false");
		SpringApplication.run(Application.class, args);
	}
}
